package com.wuzhiming.istudy.mapper;

import com.wuzhiming.istudy.pojo.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @ClassName: CommentMapper
 * @Description: 用户评论mapper
 * @Author:zhimingw
 * @Version 1.0
 * @since 2022/3/16 19:01
 */
@Mapper
public interface CommentMapper {
    /**
    * @Description: 添加评论
    * @Param: [comment]
    * @return: int
    * @Author: zhimingw
    * @Date: 2022/3/24
    */
    int addComment(Comment comment);

    /**
    * @Description: 获得某个课程下所有评论
    * @Param: [course_id]
    * @return: java.util.List<com.wuzhiming.istudy.pojo.Comment>
    * @Author: zhimingw
    * @Date: 2022/3/24
    */
    List<Comment> queryCommentById(Integer courseId);
    
    /**
    * @Description: 获得某个用户的所有评论 
    * @Param: [userId]
    * @return: java.util.List<com.wuzhiming.istudy.pojo.Comment>
    * @Author: zhimingw
    * @Date: 2022/3/26
    */
    List<Comment> getUserComment(Comment comment);

    /**
     * @Description: 获取评论的数量
     * @Param: []
     * @return: java.lang.Integer
     * @Author: zhimingw
     * @Date: 2021/7/5
     */
    Integer getCount(Integer status);
    
    /**
    * @Description: 获取所有评论
    * @Param: []
    * @return: java.util.List<com.wuzhiming.istudy.pojo.Comment>
    * @Author: zhimingw
    * @Date: 2022/3/31
    */
    List<Comment> queryAll();

    /**
    * @Description: 修改评论状态
    * @Param: [comment]
    * @return: java.lang.Integer
    * @Author: zhimingw
    * @Date: 2022/3/31
    */
    Integer update(Comment comment);
}
